package com.yhd.tomcat.listener;

import com.yhd.tomcat.handler.Handler;
import com.yhd.tomcat.handler.service.ServiceHandler;
import com.yhd.tomcat.publish.PublishAdapter;

import java.net.Socket;
import java.util.Observable;
import java.util.Observer;

/**
 * @author yhd
 * @email yinhuidong1@xiaomi.com
 * @description TODO
 * @since 2021/6/10 下午4:41
 */
@Deprecated
public class EventListener extends Handler implements  Observer {

    private ServiceHandler serviceHandler=ServiceHandler.getSingleton();


    @Override
    public void update(Observable observable, Object o) {
        try {
            PublishAdapter publishAdapter= (PublishAdapter) observable;
            Socket socket = (Socket) o;
            serviceHandler.process(socket);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
